package cn.com.nwpu.visual_system.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;

/**
 * @author Hutengzhong
 * @version 1.0.0
 * @title SensorProcessData
 * @description TODO 41个过程传感器
 * @date 2024/4/27 22:04
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SensorProcessData {
    private Integer sensorDataId;
    private LocalDateTime insertTime;
    private Double XMEAS1;
    private Double XMEAS2;
    private Double XMEAS3;
    private Double XMEAS4;
    private Double XMEAS5;
    private Double XMEAS6;
    private Double XMEAS7;
    private Double XMEAS8;
    private Double XMEAS9;
    private Double XMEAS10;
    private Double XMEAS11;
    private Double XMEAS12;
    private Double XMEAS13;
    private Double XMEAS14;
    private Double XMEAS15;
    private Double XMEAS16;
    private Double XMEAS17;
    private Double XMEAS18;
    private Double XMEAS19;
    private Double XMEAS20;
    private Double XMEAS21;
    private Double XMEAS22;
    private Double XMEAS23;
    private Double XMEAS24;
    private Double XMEAS25;
    private Double XMEAS26;
    private Double XMEAS27;
    private Double XMEAS28;
    private Double XMEAS29;
    private Double XMEAS30;
    private Double XMEAS31;
    private Double XMEAS32;
    private Double XMEAS33;
    private Double XMEAS34;
    private Double XMEAS35;
    private Double XMEAS36;
    private Double XMEAS37;
    private Double XMEAS38;
    private Double XMEAS39;
    private Double XMEAS40;
    private Double XMEAS41;

    public SensorProcessData(HashMap parameters) {
        if (parameters == null) {
            return;
        } else {
            if (parameters.containsKey("sensorDataId")) {
                sensorDataId = Integer.parseInt((String) parameters.get("sensorDataId"));
            }
            if (parameters.containsKey("insertTime")) {
                insertTime = LocalDateTime.parse((String) parameters.get("birthday"),
                        DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
            }
            if (parameters.containsKey("XMEAS1")) {
                XMEAS1 = Double.parseDouble((String) parameters.get("XMEAS1"));
            }
            if (parameters.containsKey("XMEAS2")) {
                XMEAS2 = Double.parseDouble((String) parameters.get(XMEAS2));
            }
            if (parameters.containsKey("XMEAS3")) {
                XMEAS3 = Double.parseDouble((String) parameters.get("XMEAS3"));
            }
            if (parameters.containsKey("XMEAS4")) {
                XMEAS4 = Double.parseDouble((String) parameters.get("XMEAS4"));
            }
            if (parameters.containsKey("XMEAS5")) {
                XMEAS5 = Double.parseDouble((String) parameters.get("XMEAS5"));
            }
            if (parameters.containsKey("XMEAS6")) {
                XMEAS6 = Double.parseDouble((String) parameters.get("XMEAS6"));
            }
            if (parameters.containsKey("XMEAS7")) {
                XMEAS7 = Double.parseDouble((String) parameters.get("XMEAS7"));
            }
            if (parameters.containsKey("XMEAS8")) {
                XMEAS8 = Double.parseDouble((String) parameters.get("XMEAS8"));
            }
            if (parameters.containsKey("XMEAS9")) {
                XMEAS9 = Double.parseDouble((String) parameters.get("XMEAS9"));
            }
            if (parameters.containsKey("XMEAS10")) {
                XMEAS10 = Double.parseDouble((String) parameters.get("XMEAS10"));
            }
            if (parameters.containsKey("XMEAS11")) {
                XMEAS11 = Double.parseDouble((String) parameters.get("XMEAS11"));
            }
            if (parameters.containsKey("XMEAS12")) {
                XMEAS12 = Double.parseDouble((String) parameters.get("XMEAS12"));
            }
            if (parameters.containsKey("XMEAS13")) {
                XMEAS13 = Double.parseDouble((String) parameters.get("XMEAS13"));
            }
            if (parameters.containsKey("XMEAS14")) {
                XMEAS14 = Double.parseDouble((String) parameters.get("XMEAS14"));
            }
            if (parameters.containsKey("XMEAS15")) {
                XMEAS15 = Double.parseDouble((String) parameters.get("XMEAS15"));
            }
            if (parameters.containsKey("XMEAS16")) {
                XMEAS16 = Double.parseDouble((String) parameters.get("XMEAS16"));
            }
            if (parameters.containsKey("XMEAS17")) {
                XMEAS17 = Double.parseDouble((String) parameters.get("XMEAS17"));
            }
            if (parameters.containsKey("XMEAS18")) {
                XMEAS18 = Double.parseDouble((String) parameters.get("XMEAS18"));
            }
            if (parameters.containsKey("XMEAS19")) {
                XMEAS19 = Double.parseDouble((String) parameters.get("XMEAS19"));
            }
            if (parameters.containsKey("XMEAS20")) {
                XMEAS20 = Double.parseDouble((String) parameters.get("XMEAS20"));
            }
            if (parameters.containsKey("XMEAS21")) {
                XMEAS21 = Double.parseDouble((String) parameters.get("XMEAS21"));
            }
            if (parameters.containsKey("XMEAS22")) {
                XMEAS22 = Double.parseDouble((String) parameters.get("XMEAS22"));
            }
            if (parameters.containsKey("XMEAS23")) {
                XMEAS23 = Double.parseDouble((String) parameters.get("XMEAS23"));
            }
            if (parameters.containsKey("XMEAS24")) {
                XMEAS24 = Double.parseDouble((String) parameters.get("XMEAS24"));
            }
            if (parameters.containsKey("XMEAS25")) {
                XMEAS25 = Double.parseDouble((String) parameters.get("XMEAS25"));
            }
            if (parameters.containsKey("XMEAS26")) {
                XMEAS26 = Double.parseDouble((String) parameters.get("XMEAS26"));
            }
            if (parameters.containsKey("XMEAS27")) {
                XMEAS27 = Double.parseDouble((String) parameters.get("XMEAS27"));
            }
            if (parameters.containsKey("XMEAS28")) {
                XMEAS28 = Double.parseDouble((String) parameters.get("XMEAS28"));
            }
            if (parameters.containsKey("XMEAS29")) {
                XMEAS29 = Double.parseDouble((String) parameters.get("XMEAS29"));
            }
            if (parameters.containsKey("XMEAS30")) {
                XMEAS30 = Double.parseDouble((String) parameters.get("XMEAS30"));
            }
            if (parameters.containsKey("XMEAS31")) {
                XMEAS31 = Double.parseDouble((String) parameters.get("XMEAS31"));
            }
            if (parameters.containsKey("XMEAS32")) {
                XMEAS32 = Double.parseDouble((String) parameters.get("XMEAS32"));
            }
            if (parameters.containsKey("XMEAS33")) {
                XMEAS33 = Double.parseDouble((String) parameters.get("XMEAS33"));
            }
            if (parameters.containsKey("XMEAS34")) {
                XMEAS34 = Double.parseDouble((String) parameters.get("XMEAS34"));
            }
            if (parameters.containsKey("XMEAS35")) {
                XMEAS35 = Double.parseDouble((String) parameters.get("XMEAS35"));
            }
            if (parameters.containsKey("XMEAS36")) {
                XMEAS36 = Double.parseDouble((String) parameters.get("XMEAS36"));
            }
            if (parameters.containsKey("XMEAS37")) {
                XMEAS37 = Double.parseDouble((String) parameters.get("XMEAS37"));
            }
            if (parameters.containsKey("XMEAS38")) {
                XMEAS38 = Double.parseDouble((String) parameters.get("XMEAS38"));
            }
            if (parameters.containsKey("XMEAS39")) {
                XMEAS39 = Double.parseDouble((String) parameters.get("XMEAS39"));
            }
            if (parameters.containsKey("XMEAS40")) {
                XMEAS40 = Double.parseDouble((String) parameters.get("XMEAS40"));
            }
            if (parameters.containsKey("XMEAS41")) {
                XMEAS41 = Double.parseDouble((String) parameters.get("XMEAS41"));
            }
        }
    }
}
